home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIFactory.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  134 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIFactory.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIFactory_h__
  6. #define __gen_nsIFactory_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsIFactory */
  19. #define NS_IFACTORY_IID_STR "00000001-0000-0000-c000-000000000046"
  20.  
  21. #define NS_IFACTORY_IID \
  22.   {0x00000001, 0x0000, 0x0000, \
  23.     { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }}
  24.  
  25. /**
  26.  * A class factory allows the creation of nsISupports derived
  27.  * components without specifying a concrete base class.  
  28.  *
  29.  * @status FROZEN
  30.  */
  31. class NS_NO_VTABLE nsIFactory : public nsISupports {
  32.  public: 
  33.  
  34.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFACTORY_IID)
  35.  
  36.   /**
  37.     * Creates an instance of a component.
  38.     *
  39.     * @param aOuter Pointer to a component that wishes to be aggregated
  40.     *               in the resulting instance. This will be nsnull if no
  41.     *               aggregation is requested.
  42.     * @param iid    The IID of the interface being requested in
  43.     *               the component which is being currently created.
  44.     * @param result [out] Pointer to the newly created instance, if successful.
  45.     * @return NS_OK - Component successfully created and the interface 
  46.     *                 being requested was successfully returned in result.
  47.     *         NS_NOINTERFACE - Interface not accessible.
  48.     *         NS_ERROR_NO_AGGREGATION - if an 'outer' object is supplied, but the
  49.     *                                   component is not aggregatable.
  50.     *         NS_ERROR* - Method failure.
  51.     */
  52.   /* void createInstance (in nsISupports aOuter, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result); */
  53.   NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result) = 0;
  54.  
  55.   /**
  56.     * LockFactory provides the client a way to keep the component
  57.     * in memory until it is finished with it. The client can call
  58.     * LockFactory(PR_TRUE) to lock the factory and LockFactory(PR_FALSE)
  59.     * to release the factory.     
  60.     *
  61.     * @param lock - Must be PR_TRUE or PR_FALSE
  62.     * @return NS_OK - If the lock operation was successful.
  63.     *         NS_ERROR* - Method failure.
  64.     */
  65.   /* void lockFactory (in PRBool lock); */
  66.   NS_IMETHOD LockFactory(PRBool lock) = 0;
  67.  
  68. };
  69.  
  70. /* Use this macro when declaring classes that implement this interface. */
  71. #define NS_DECL_NSIFACTORY \
  72.   NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result); \
  73.   NS_IMETHOD LockFactory(PRBool lock); 
  74.  
  75. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  76. #define NS_FORWARD_NSIFACTORY(_to) \
  77.   NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result) { return _to CreateInstance(aOuter, iid, result); } \
  78.   NS_IMETHOD LockFactory(PRBool lock) { return _to LockFactory(lock); } 
  79.  
  80. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  81. #define NS_FORWARD_SAFE_NSIFACTORY(_to) \
  82.   NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateInstance(aOuter, iid, result); } \
  83.   NS_IMETHOD LockFactory(PRBool lock) { return !_to ? NS_ERROR_NULL_POINTER : _to->LockFactory(lock); } 
  84.  
  85. #if 0
  86. /* Use the code below as a template for the implementation class for this interface. */
  87.  
  88. /* Header file */
  89. class nsFactory : public nsIFactory
  90. {
  91. public:
  92.   NS_DECL_ISUPPORTS
  93.   NS_DECL_NSIFACTORY
  94.  
  95.   nsFactory();
  96.  
  97. private:
  98.   ~nsFactory();
  99.  
  100. protected:
  101.   /* additional members */
  102. };
  103.  
  104. /* Implementation file */
  105. NS_IMPL_ISUPPORTS1(nsFactory, nsIFactory)
  106.  
  107. nsFactory::nsFactory()
  108. {
  109.   /* member initializers and constructor code */
  110. }
  111.  
  112. nsFactory::~nsFactory()
  113. {
  114.   /* destructor code */
  115. }
  116.  
  117. /* void createInstance (in nsISupports aOuter, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result); */
  118. NS_IMETHODIMP nsFactory::CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result)
  119. {
  120.     return NS_ERROR_NOT_IMPLEMENTED;
  121. }
  122.  
  123. /* void lockFactory (in PRBool lock); */
  124. NS_IMETHODIMP nsFactory::LockFactory(PRBool lock)
  125. {
  126.     return NS_ERROR_NOT_IMPLEMENTED;
  127. }
  128.  
  129. /* End of implementation class template. */
  130. #endif
  131.  
  132.  
  133. #endif /* __gen_nsIFactory_h__ */
  134.